CC = @CC@
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@
WARNINGS_FLAGS = -Wall -Wextra
ASFLAGS = @ASFLAGS@
LDFLAGS = @LDFLAGS@
EXEEXT = @EXEEXT@
MKDIR = @MKDIR@
INSTALL= @INSTALL@

prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
datadir = @datadir@
datarootdir = @datarootdir@

all: python-wrapper$(EXEEXT)

python-wrapper$(EXEEXT): config.h python-wrapper.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(WARNINGS_FLAGS) $(ASFLAGS) $(LDFLAGS) -o $@ python-wrapper.c

install: all
	$(MKDIR) $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)/eselect/modules
	$(INSTALL) python-wrapper$(EXEEXT) $(DESTDIR)$(bindir)/python-wrapper$(EXEEXT)
	$(INSTALL) -m 644 python.eselect $(DESTDIR)$(datadir)/eselect/modules/python.eselect

clean:
	rm -fr python-wrapper$(EXEEXT)

distclean: clean
	rm -fr config.h config.log config.status Makefile

extraclean: distclean
	rm -fr config.h.in configure
